let bench_obj file_name =
    let time = ref 0. in
    Printf.printf "Lecture de fichier OBJ %s ...\n" file_name;
    time := Sys.time();
    let file = new ObjFile.obj_file in
    file#load_from file_name;
    Printf.printf " [DONE] \n Exectuion Time : %f\n" (Sys.time () -. !time);
    Printf.printf " %i v | %i vn | %i f found\n" (Array.length (file#get_v_tab))
    (Array.length file#get_vn_tab) (Array.length file#get_f_tab);
    Printf.printf "Ecriture du fichier OBJ %s.out ...\n" file_name;
    time := Sys.time();
    file#save_to (file_name^".out");
    Printf.printf " [DONE] \n Exectuion Time : %f\n" (Sys.time () -. !time)

let main() =
    if (Array.length Sys.argv) = 1 then
        App.run()
    else
        let command_line =[
            "--bench-obj", 
                Arg.String(bench_obj), 
                "lauch obj modulebenchmarking";
            "-o",
                Arg.String(Printexc.print Obj_test.main), 
                "open a obj file";
            "-3D",
                Arg.Unit(Printexc.print Test3D.main),
                "test the 3D engine"
        ]
        in
        Arg.parse command_line (function s -> ()) "usage msg"

let _ = main ()

